Namespace Controls
    <Serializable(), ObfuscationAttribute(Exclude:=True, ApplyToMembers:=True)> _
    Friend Class DataGridSettingCollection
        Inherits DataStream.StreamControlSettingCollection

        Private m_FindNearest As Boolean = False

        Public Sub InitialiseValidItems(ByVal Items() As String)
            If Not IsNothing(Items) AndAlso Items.Length > 0 Then
                For i As Integer = 0 To Items.Length - 1
                    If Items(i) Is Nothing Then
                        Debug.Print("NOTHING!!")
                    ElseIf Not Me.Contains(Items(i)) Then
                        Me.Add(New DataGridSetting(Items(i), Color.Blue, False))
                    End If
                Next
            End If
        End Sub

        Public Overrides Sub GetObjectDataAdditionalSerialization(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext)
            MyBase.GetObjectDataAdditionalSerialization(info, context)
            info.AddValue("m_FindNearest", m_FindNearest, m_FindNearest.GetType)
        End Sub

        Public Overrides Sub NewAdditionalDeserialization(ByVal Info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext)
            MyBase.NewAdditionalDeserialization(Info, context)

            Try
                m_FindNearest = Info.GetBoolean("m_FindNearest")
            Catch ex As Exception
                m_FindNearest = False
            End Try
        End Sub

        Public Property FindNearest() As Boolean
            Get
                Return m_FindNearest
            End Get
            Set(ByVal value As Boolean)
                m_FindNearest = value
            End Set
        End Property
    End Class
End Namespace
